package Code.Objects.Characters.Player.Misc;

import org.jrabbit.base.managers.ResourceManager;
import org.jrabbit.standard.game.sound.Sound;

public class PlayerSounds
{
	private static boolean initialized = false;
	
	private static Sound[] footsteps = null;
	
	private static Sound warningTone = null;
	
	public static void initialize()
	{
		if(!initialized)
		{
			footsteps = new Sound[4];
			footsteps[0] = new Sound("Resources/Sounds/Effects/Game/Characters/Player/Movement/Gravel footstep 1.ogg");
			footsteps[1] = new Sound("Resources/Sounds/Effects/Game/Characters/Player/Movement/Gravel footstep 2.ogg");
			footsteps[2] = new Sound("Resources/Sounds/Effects/Game/Characters/Player/Movement/Gravel footstep 3.ogg");
			footsteps[3] = new Sound("Resources/Sounds/Effects/Game/Characters/Player/Movement/Gravel footstep 4.ogg");
			
			warningTone = new Sound("Resources/Sounds/Effects/Game/Characters/Player/GUI/Warning tone.ogg");
			
			initialized = true;
		}
	}
	
	public static void playFootstep(float volume)
	{
		initialize();
		footsteps[ResourceManager.random().nextInt(footsteps.length)].playOnce(1f, volume);
	}
	
	public static void playWarningTone(float volume)
	{
		initialize();
		warningTone.playOnce(1f, volume);
	}
}
